/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Frame.java
 *
 * Created on 21/06/2009, 04:47:04 PM
 */

/**
 *
 * @author Propietario
 */
public class Frame extends javax.swing.JFrame {

    /** Creates new form Frame */
    public Frame() {
        initComponents();
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {

            }
        });

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        selectorArchivos = new javax.swing.JFileChooser();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaCache1 = new javax.swing.JTable();
        campoTextoPrueba = new javax.swing.JTextField();
        boton = new javax.swing.JButton();
        barraMenu = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        menuEdición = new javax.swing.JMenu();

        selectorArchivos.setMultiSelectionEnabled(true);
        selectorArchivos.setName("selectorArchivos"); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(simulador.SimuladorApp.class).getContext().getResourceMap(Frame.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tablaCache1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tablaCache1.setName("tablaCache1"); // NOI18N
        tablaCache1.addHierarchyBoundsListener(new java.awt.event.HierarchyBoundsListener() {
            public void ancestorMoved(java.awt.event.HierarchyEvent evt) {
            }
            public void ancestorResized(java.awt.event.HierarchyEvent evt) {
                tablaCache1_listenerAncestroResized(evt);
            }
        });
        jScrollPane1.setViewportView(tablaCache1);

        campoTextoPrueba.setText(resourceMap.getString("campoTextoPrueba.text")); // NOI18N
        campoTextoPrueba.setName("campoTextoPrueba"); // NOI18N

        boton.setText(resourceMap.getString("boton.text")); // NOI18N
        boton.setName("boton"); // NOI18N
        boton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonActionPerformed(evt);
            }
        });

        barraMenu.setName("BarraMenu"); // NOI18N

        jMenu1.setText(resourceMap.getString("menuArchivo.text")); // NOI18N
        jMenu1.setToolTipText(resourceMap.getString("menuArchivo.toolTipText")); // NOI18N
        jMenu1.setName("menuArchivo"); // NOI18N
        jMenu1.setNextFocusableComponent(menuEdición);

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem1.setText(resourceMap.getString("itemMenuAbrir.text")); // NOI18N
        jMenuItem1.setName("itemMenuAbrir"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemMenuAbrirListener(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        barraMenu.add(jMenu1);

        menuEdición.setText(resourceMap.getString("menuEdicion.text")); // NOI18N
        menuEdición.setToolTipText(resourceMap.getString("menuEdicion.toolTipText")); // NOI18N
        menuEdición.setName("menuEdicion"); // NOI18N
        menuEdición.setNextFocusableComponent(this);
        barraMenu.add(menuEdición);

        setJMenuBar(barraMenu);
        barraMenu.getAccessibleContext().setAccessibleParent(this);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(campoTextoPrueba, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(44, 44, 44)
                        .addComponent(boton, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(15, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(67, 67, 67)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(46, 46, 46)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoTextoPrueba, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(boton, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(56, Short.MAX_VALUE))
        );

        boton.getAccessibleContext().setAccessibleName(resourceMap.getString("boton.AccessibleContext.accessibleName")); // NOI18N

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void itemMenuAbrirListener(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemMenuAbrirListener
        this.selectorArchivos.showOpenDialog(jMenu1);
    }//GEN-LAST:event_itemMenuAbrirListener

    private void tablaCache1_listenerAncestroResized(java.awt.event.HierarchyEvent evt) {//GEN-FIRST:event_tablaCache1_listenerAncestroResized
        // TODO add your handling code here:
    }//GEN-LAST:event_tablaCache1_listenerAncestroResized

    private void botonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonActionPerformed
        
        //while(true){
            this.campoTextoPrueba.setText(""+i++);
            //this.campoTextoPrueba.setVisible(false);
            //this.campoTextoPrueba.setVisible(true);
        //}
    }//GEN-LAST:event_botonActionPerformed
int i = 0;
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Frame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar barraMenu;
    private javax.swing.JButton boton;
    public javax.swing.JTextField campoTextoPrueba;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenu menuEdición;
    private javax.swing.JFileChooser selectorArchivos;
    private javax.swing.JTable tablaCache1;
    // End of variables declaration//GEN-END:variables

}
